﻿using System;
using System.Net;
using System.IO;
using Qadir.Net;

namespace QadirHTTPSample
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Title = "Qadir.Net Demo";
            while (true)
            {
                Console.Write("Enter a URL to pull HTML: ");
                string url = Console.ReadLine();
                try
                {
                    string html = Internet.SurfAsText(url);
                    Console.WriteLine(string.Format("Pulled HTML:\n{0}", html));
                }
                catch
                {
                    Console.WriteLine("\nCould not successfully pull HTML.");
                }
                finally
                {
                    Console.WriteLine("Hit ENTER to continue.");
                    Console.ReadLine();
                    Console.Clear();
                }
            }
        }
    }
}
